import * as React from 'react';
import { useNavigate } from 'react-router-dom';


export default function Back( {...props} ) {
	const navigate = useNavigate()
	React.useEffect(()=>{
		let timer = setTimeout(()=>{
			navigate('/')
		},3000)
		return ()=>{clearTimeout(timer)}
	},[navigate])
	return (
		<div>
			<main style={{ padding: "1rem 0" }}>
				<h2>Back</h2>
				{props.children}
			</main>
		</div>
	);
}

